<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="~{common/commons::topbar}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="~{common/commons::sidebar(active='courseList.html')}"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>修改课程信息</h2>
            <form th:action="@{/updateCourse}" method="post">
                <input name="id" type="hidden" class="form-control" th:value="${course.id}">
                <div class="form-group">
                    <label>课程名称</label>
                    <input name="coursename" type="text" class="form-control " th:value="${course.coursename}" >
                </div>
                <div class="form-group">
                    <label>上课地点</label>
                    <input name="place" type="text" class="form-control " th:value="${course.place}" >
                </div>
                <div class="form-group">
                    <label>上课时间</label>
                    <input name="time" type="text"  class="form-control" id="time" autocomplete="off" th:value="${#dates.format(course.time,'yyyy-MM-dd HH:mm:ss')}" required>
                </div>
                <div class="form-group">
                    <label>打卡截止时间（分钟）</label>
                    <input name="aborttime" type="text"  class="form-control"  autocomplete="off" th:value="${course.aborttime}" required>
                </div>
                <div class="form-group">
                    <label>开课部门</label>
                    <!--提交的是部门的ID-->
                    <select class="form-control" name="departmentid">
                        <option th:selected="${dept.id == course.departmentid}" th:each="dept:${departments}"
                                th:text="${dept.departmentname}" th:value="${dept.id}">1
                        </option>
                    </select>
                </div>
                <div class="form-group">
                    <label>学分</label>
                    <input name="credits" type="text" class="form-control " th:value="${course.credits}" >
                </div>
                <div class="form-group">
                    <label >课程类型</label>
                    <select class="form-control" name="type" required>
                        <option value="">请选择</option>
                        <option value="1">公共课</option>
                        <option value="2">专业课</option>
                    </select>
                </div>
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" th:src="@{/js/jquery-3.2.1.slim.min.js}"></script>
<script type="text/javascript" th:src="@{/js/popper.min.js}"></script>
<script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>
<!--		日期组件-->
<script type="text/javascript" th:src="@{/laydate/laydate.js}"></script> <!-- 改成你的路径 -->
<script>
    //执行一个laydate实例
    laydate.render({
        elem: '#time',
        type:'datetime',
        trigger:'click'//指定元素
    });
</script>
</body>

</html>